package com.example.ragproject.tools;

import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;


/***
 * 三大注解 @tool  @p  @memoryId
 */
//@Component
public class CalculatorTools {


    /**
     *
     * @param a
     * @param b
     * @return
     */
    @Tool(name = "加法",value = "将两个数相加")
    double sum(@P(value = "加数1") double a, double b){
        System.out.println("调用加法运算");
        return a + b;
    }



    @Tool(name = "平方根")
    double squareRoot(double x){
        System.out.println("调用平方根运算");
        return Math.sqrt(x);
    }







}
